package com.lala.controller;

import com.lala.entity.OrderDetails;
import com.lala.service.OrderDetailsService;
import com.lala.util.ResultJson;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * (OrderDetails)表控制层
 *
 * @author lixu
 * @since 2020-03-24 09:43:32
 */
@RestController
@RequestMapping("orderDetails")
public class OrderDetailsController {
    /**
     * 服务对象
     */
    @Resource
    private OrderDetailsService orderDetailsService;

    /**
     * @param id
     * @ClassName OrderDetailsController
     * @Description : 查询订单详情
     * @Return : com.lala.entity.OrderDetails
     * @Author : lixu
     * @Date : 2020/3/25 16:59
     */
    @GetMapping("selectById")
    @ResponseBody
    public ResultJson selectOne(Integer id) {
        OrderDetails orderDetails = orderDetailsService.queryById(id);
        return new ResultJson(200, "", orderDetails);
    }

    @GetMapping("selectAll")
    @ResponseBody
    public ResultJson selectAll(Integer clientId) {
        List<OrderDetails> orderDetails = orderDetailsService.selectAll(clientId);
        return new ResultJson(200, "", orderDetails);
    }


}